From: Keir Fraser Date: Fri, 13 Jun 2008 12:47:28 +0000 (+0100) Subject: 32-on-64: Fix error handling for XENMEM_decrease_reservation. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14192^2~73 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=6c6d249dd5cbaecc415c2c9e2831201c4793ecc2;p=xen.git 32-on-64: Fix error handling for XENMEM_decrease_reservation. Signed-off-by: Keir Fraser --- diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c index 491a9ce568..17519f5688 100644 --- a/xen/common/compat/memory.c +++ b/xen/common/compat/memory.c @@ -250,7 +250,7 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE(void) compat) case XENMEM_decrease_reservation: case XENMEM_populate_physmap: end_extent = split >= 0 ? rc : cmd >> MEMOP_EXTENT_SHIFT; - if ( op != XENMEM_decrease_reservation && + if ( (op != XENMEM_decrease_reservation) && !guest_handle_is_null(nat.rsrv->extent_start) ) { for ( ; start_extent < end_extent; ++start_extent ) @@ -276,13 +276,14 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE(void) compat) break; } } - - /* Bail if there was an error. */ - if ( (split >= 0) && (end_extent != nat.rsrv->nr_extents) ) - split = 0; } else + { start_extent = end_extent; + } + /* Bail if there was an error. */ + if ( (split >= 0) && (end_extent != nat.rsrv->nr_extents) ) + split = 0; break; case XENMEM_exchange: